package com.dferreira.repository.data_models;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName = RepositoryDependency.TABLE_NAME)
public class RepositoryDependency {

    @DatabaseField(generatedId = true)
    private Integer id;

    public static final String TABLE_NAME = "repositoryDependency";
    public static final String COLUMN_NAME_FOR_PACKAGE = "for_package";
    public static final String COLUMN_NAME_FROM_PACKAGE = "from_package";

    @DatabaseField(foreign = true, columnName = COLUMN_NAME_FOR_PACKAGE)
    private RepositoryPackage forPackage;
    @DatabaseField(foreign = true, columnName = COLUMN_NAME_FROM_PACKAGE, foreignAutoRefresh = true)
    private RepositoryPackage fromPackage;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public RepositoryPackage getForPackage() {
        return forPackage;
    }

    public void setForPackage(RepositoryPackage forPackage) {
        this.forPackage = forPackage;
    }

    public RepositoryPackage getFromPackage() {
        return fromPackage;
    }

    public void setFromPackage(RepositoryPackage fromPackage) {
        this.fromPackage = fromPackage;
    }

    @Override
    public String toString() {
        return "RepositoryDependency [forPackage=" + forPackage
                + ", fromPackage=" + fromPackage + "]";
    }


}
